Telegram Group & Telegram Channel
#нововведение

PEP 695 был принят! 🚨

PEP 695

В ближайщее время произойдут значительные изменения в синтаксе тайпваров и дженериков.
Вот как сейчас мы создаём generic type alias:

from typing import TypeAlias

_T = TypeVar("_T")

ListOrSet: TypeAlias = list[_T] | set[_T]

Теперь с утверждением данного пепа, это будет выглядить так:

type ListOrSet[T] = list[T] | set[T]

Кроме того синтаксис использования дженериков в классах также упростили.
Теперь он выглядить так:

class ClassA[T: str]:
def method1(self) -> T:
...


Где T - TypeVar.

Подробнее можно почитать об изменения тут.

Что вы думате по поводу подобных изменений? Считаете ли вы введение "var подобных" объявлений, хорошим вектором развития синтаксиса питона? 🤔



tg-me.com/pythonturboru/402
Create:
Last Update:

#нововведение

PEP 695 был принят! 🚨

PEP 695

В ближайщее время произойдут значительные изменения в синтаксе тайпваров и дженериков.
Вот как сейчас мы создаём generic type alias:

from typing import TypeAlias

_T = TypeVar("_T")

ListOrSet: TypeAlias = list[_T] | set[_T]

Теперь с утверждением данного пепа, это будет выглядить так:

type ListOrSet[T] = list[T] | set[T]

Кроме того синтаксис использования дженериков в классах также упростили.
Теперь он выглядить так:

class ClassA[T: str]:
def method1(self) -> T:
...


Где T - TypeVar.

Подробнее можно почитать об изменения тут.

Что вы думате по поводу подобных изменений? Считаете ли вы введение "var подобных" объявлений, хорошим вектором развития синтаксиса питона? 🤔

BY Python Turbo. Уютное сообщество Python разработчиков.




Share with your friend now:
tg-me.com/pythonturboru/402

View MORE
Open in Telegram


Python Turbo Уютное сообщество Python разработчиков Telegram | DID YOU KNOW?

Date: |

What is Telegram Possible Future Strategies?

Cryptoassets enthusiasts use this application for their trade activities, and they may make donations for this cause.If somehow Telegram do run out of money to sustain themselves they will probably introduce some features that will not hinder the rudimentary principle of Telegram but provide users with enhanced and enriched experience. This could be similar to features where characters can be customized in a game which directly do not affect the in-game strategies but add to the experience.

Export WhatsApp stickers to Telegram on iPhone

You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.

Python Turbo Уютное сообщество Python разработчиков from vn


Telegram Python Turbo. Уютное сообщество Python разработчиков.
FROM USA